export function request(config={}){
	let {url,data={},method="GET",header} = config
	let BASE_URL = 'http://192.168.1.100:8080/zh-admin'
	url = BASE_URL +url
	return new Promise((resolve,reject)=>{
		uni.request({
			url,
			method,
			header, 
			data,
			success(res) {
				if(res.data.code==200){
					resolve(res.data)
				}else{
					reject(res.data)
					uni.showToast({
						title:res.data.msg,
						icon:'none'
					})
				}
			},
			fail(err) {
				reject(err)
				uni.showToast({
					title:err,
					icon:'none'
				})
			}
		})
	})
}